﻿<phone:PhoneApplicationPage 
    x:Class="MineSweeping.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:MineSweeping.AppCode"  
    mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="480"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Landscape" Orientation="Landscape"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <!--Converters -->
        <local:ShowTimeConverter x:Key="ShowTimeConverter" />
        <local:BtnFlagVisbilityConverter x:Key="BtnFlagVisbilityConverter" />
        <local:BtnFlagBackgroundConverter x:Key="BtnFlagBackgroundConverter" />
        <local:ImageStatusSourceConverter x:Key="ImageStatusSourceConverter" />

        <Style x:Key="PhoneButtonBase" TargetType="ButtonBase">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="Padding" Value="10,3,10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ButtonBase">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="PhoneRadioButtonCheckBoxBase" BasedOn="{StaticResource PhoneButtonBase}" TargetType="ToggleButton">
            <Setter Property="Background" Value="{StaticResource PhoneRadioCheckBoxBrush}"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneRadioCheckBoxBrush}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="0"/>
        </Style>
        <Style x:Key="RadioDifficultyStyle" BasedOn="{StaticResource PhoneRadioButtonCheckBoxBase}" TargetType="RadioButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RadioButton">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PressedDarkCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="PressedLightCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledDarkCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledLightCheckBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CheckMark">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked"/>
                                    <VisualState x:Name="Indeterminate"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Margin="{StaticResource PhoneTouchTargetLargeOverhang}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="32"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Ellipse x:Name="EnabledCheckBackground" Fill="{TemplateBinding Background}" HorizontalAlignment="Left" Height="32" IsHitTestVisible="False" VerticalAlignment="Center" Width="32"/>
                                <Canvas HorizontalAlignment="Left" Height="32" IsHitTestVisible="False" Opacity="{StaticResource PhoneDarkThemeOpacity}" VerticalAlignment="Center" Width="32">
                                    <Ellipse x:Name="PressedDarkCheckBackground" Fill="{StaticResource PhoneRadioCheckBoxPressedBrush}" Height="32" Visibility="Collapsed" Width="32"/>
                                    <Ellipse x:Name="DisabledDarkCheckBackground" Fill="{StaticResource PhoneRadioCheckBoxDisabledBrush}" Height="32" Visibility="Collapsed" Width="32"/>
                                </Canvas>
                                <Canvas HorizontalAlignment="Left" Height="32" IsHitTestVisible="False" Opacity="{StaticResource PhoneLightThemeOpacity}" VerticalAlignment="Center" Width="32">
                                    <Ellipse x:Name="PressedLightCheckBackground" Fill="{StaticResource PhoneRadioCheckBoxPressedBrush}" Height="32" Stroke="{StaticResource PhoneForegroundBrush}" Visibility="Collapsed" Width="32"/>
                                    <Ellipse x:Name="DisabledLightCheckBackground" Fill="{StaticResource PhoneRadioCheckBoxDisabledBrush}" Height="32" Stroke="{StaticResource PhoneDisabledBrush}" Visibility="Collapsed" Width="32"/>
                                </Canvas>
                                <Ellipse x:Name="CheckMark" HorizontalAlignment="Center" Height="16" IsHitTestVisible="False" Visibility="Collapsed" VerticalAlignment="Center" Width="16" Fill="#FF9224D4"/>
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="12,0,0,0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="PopStarButtontStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FF51515C" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="btnStart" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="#FF37373F" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="btnStart" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle x:Name="btnStart" RadiusX="4" RadiusY="4">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF47474E" Offset="0.062"/>
                                        <GradientStop Color="#FF37373F" Offset="0.959"/>
                                        <GradientStop Color="#FF010102" Offset="0.8"/>
                                        <GradientStop Color="#FF09090A" Offset="0.227"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BtnGameNavStyle" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="Padding" Value="10,3,10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#00000000" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ColorAnimation Duration="0" To="#FF0B0A2F" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle x:Name="rectangle" Fill="#00000000"/>
                            <Border x:Name="ButtonBackground" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="7">
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BtnNavToTops" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Disabled"/>
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="MouseOver"/>
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ColorAnimation Duration="0" To="#FF6EB4D0" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FF78CEF1" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Rectangle x:Name="rectangle" RadiusX="3" RadiusY="3">
        						<Rectangle.Fill>
        							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        								<GradientStop Color="#FF136889" Offset="0"/>
        								<GradientStop Color="#FF136889" Offset="1"/>
        								<GradientStop Color="#FF2EA0CE" Offset="0.165"/>
        								<GradientStop Color="#FF2193C0" Offset="0.814"/>
        							</LinearGradientBrush>
        						</Rectangle.Fill>
        					</Rectangle>
        					<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>

    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Black" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="110" />
            <ColumnDefinition Width="*" />

        </Grid.ColumnDefinitions>
        <!-- InfoBar -->
        <Grid x:Name="InfoPanel" Grid.Column="0" Margin="5" Background="#FF1D1D3E">
            <TextBlock x:Name="txtShowTime" Text="{Binding ShowTime,Converter={StaticResource ShowTimeConverter}}" Margin="10,10,0,0" VerticalAlignment="Top" FontSize="48" FontStretch="Normal" FontWeight="SemiBold" Foreground="White"/>
            <Image Source="/Picture/40.png"  Margin="10,76,0,0" Stretch="Fill" VerticalAlignment="Top" Width="40" Height="40" HorizontalAlignment="Left" d:LayoutOverrides="Width" />
            <TextBlock x:Name="txtMineLeftCount" Text="{Binding Path=MineLeftCount}" Margin="55,76,0,0"  Height="40" VerticalAlignment="Top" FontSize="28" FontStretch="Normal" FontWeight="SemiBold" Foreground="White" />
            <Image x:Name="imageStatue" Source="{Binding Path=IsLosing, Converter={StaticResource ImageStatusSourceConverter}}" Width="65" Height="65" HorizontalAlignment="Center" Margin="15,120,19,0" Stretch="Fill" VerticalAlignment="Top" />
            <Button x:Name="btnStart" Height="80" Width="80" Margin="10,0,10,199" VerticalAlignment="Bottom" d:LayoutOverrides="Height" Click="StartBtn_Click" BorderThickness="0" HorizontalAlignment="Center" Style="{StaticResource BtnGameNavStyle}" >
                <Button.Background>
                    <ImageBrush ImageSource="/Picture/GameStart.png" />
                </Button.Background>
            </Button>
            <Button x:Name="btnRecord" Height="80" Width="80" Margin="10,0,10,119" VerticalAlignment="Bottom" d:LayoutOverrides="Height" Click="RecordBtn_Click" BorderThickness="0" HorizontalAlignment="Center" Style="{StaticResource BtnGameNavStyle}" >
                <Button.Background>
                    <ImageBrush ImageSource="/Picture/GameRecord.png" />
                </Button.Background>
            </Button>
            <Button x:Name="btnFlag" Background="{Binding Path=IsFlaging, Converter={StaticResource BtnFlagBackgroundConverter}}" Visibility="{Binding Path=IsGameRunning, Converter={StaticResource BtnFlagVisbilityConverter}}" Height="80" Width="80" Margin="10,0,10,6" VerticalAlignment="Bottom" d:LayoutOverrides="Height" Click="FlagBtn_Click" BorderThickness="0" HorizontalAlignment="Center" Style="{StaticResource BtnGameNavStyle}" />
        </Grid>
        <!-- GameLayout-->
        <Grid Grid.Column="1">
        	<Grid.Background>
        		<ImageBrush Stretch="Fill" ImageSource="/Picture/MainBG1.png"/>
        	</Grid.Background>
            <!-- popDialog for select difficulty -->
            <ScrollViewer>
            	<Canvas x:Name="GameCanvas" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="{Binding IsGameRunning}"/>
            </ScrollViewer>
            <!-- popDialog for select difficulty -->
            <Popup x:Name="popStartGame">
                <Grid Width="680" Height="475" Margin="5,0" Opacity="0.9" >
                    <Grid.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Black" Offset="0.15"/>
                            <GradientStop Color="Black" Offset="0.85"/>
                            <GradientStop Color="#FF1F1C1C" Offset="0.05"/>
                            <GradientStop Color="#FF1F1C1C" Offset="0.95"/>
                            <GradientStop Color="#FF2F2E2E" Offset="0.98"/>
                            <GradientStop Color="#FF3D3939" Offset="0.02"/>
                        </LinearGradientBrush>
                    </Grid.Background>
                    <TextBlock Text="请选择难度：" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,30,0,0" FontSize="48" FontFamily="Mangal" Foreground="White" />
                    <RadioButton x:Name="radioEasy" Content="简单 （10 X  8  10 颗地雷）" GroupName="difficultGroup" IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,100,0,0" Style="{StaticResource RadioDifficultyStyle}" Foreground="White" FontFamily="Mangal" FontSize="26.667" />
                    <RadioButton x:Name="radioMedium" Content="中等 （12 X 12  24 颗地雷）" GroupName="difficultGroup" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,160,0,0" Style="{StaticResource RadioDifficultyStyle}" Foreground="White" FontFamily="Mangal" FontSize="26.667" />
                    <RadioButton x:Name="radioHard" Content="困难 （22 X 12  45 颗地雷）" GroupName="difficultGroup" Margin="0,220,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{StaticResource RadioDifficultyStyle}" Foreground="White" FontFamily="Mangal" FontSize="26.667" />
                    <Button x:Name="btnStartGame" Content="开 始" Width="240" Height="100" Click="btnStartGame_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="75,340,0,0" Style="{StaticResource PopStarButtontStyle}" Foreground="White" FontSize="48" />
                    <Button x:Name="btnCancelGame" Content="返 回" Width="240" Height="100" Click="btnCancelGame_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,340,75,0" Style="{StaticResource PopStarButtontStyle}" Foreground="White" FontSize="48" />
                </Grid>
            </Popup>
            <Popup x:Name="popIsLosing" IsOpen="{Binding IsLosing}">
                <Grid Width="690" Height="480">
                    <Grid  Margin="100,160">
                        <TextBlock Text="BOOM" Width="640" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="96" Foreground="#FFEDF91F" TextAlignment="Center" FontFamily="/MineSweeping;component/Fonts/Fonts.zip#Snap ITC" Height="130" FontWeight="Bold" Margin="0" />
                        <TextBlock Text="BOOM" Width="640" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="96" Foreground="#FFE95E5E" TextAlignment="Center" FontFamily="/MineSweeping;component/Fonts/Fonts.zip#Snap ITC" Height="130" FontWeight="Bold" Margin="5,0,0,5" />
                    </Grid>
                </Grid>
            </Popup>
            <Popup x:Name="popWin" IsOpen="{Binding IsWin}">
                <Grid Width="690" Height="480">
                    <Rectangle Margin="110" Opacity="0.9" Fill="#FF837878" RadiusX="10" RadiusY="10"/>
                    <Grid  Margin="100" Opacity="0.95">
                    	<Grid.Background>
                    		<ImageBrush Stretch="Fill" ImageSource="/Picture/MainBG2.jpg"/>
                    	</Grid.Background>
                    	<TextBlock Text="恭喜你 胜利了！" Margin="0,30,0,0" FontWeight="Bold" FontSize="32" HorizontalAlignment="Center" />
                    	<Image Width="50" Height="50" Source="/Picture/Timer.png" Margin="180,100,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        <TextBlock Text="{Binding ShowTime, Converter={StaticResource ShowTimeConverter}}" Margin="240,100,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="32" FontWeight="Bold" />
                    	<Button x:Name="BtnNavToTops" Content="查看排行榜" Click="BtnNavToTops_Click" HorizontalAlignment="Center" Margin="0,150,0,0" Style="{StaticResource BtnNavToTops}" Height="60" Width="200" FontWeight="Bold"/>
                    </Grid>
                </Grid>
            </Popup>
        </Grid>
    </Grid>

    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>